<?php

foreach ($tab as $t) {
    printf('<input type="checkbox" name="theme[]" value="'.$t->getNum().'">'.$t->toString().'');
}
?>